package io.github.wppli.domain.pay.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author li--jiaqiang 2025−03−19
 */
@Getter
@AllArgsConstructor
public enum ProductStatus {

    CLOSE(0, "下架"),
    OPEN(1,"上架"),
    ;

    private final Integer code;

    private final String info;

    public static ProductStatus get(Integer code){
        switch (code){
            case 0:
                return ProductStatus.CLOSE;
            case 1:
                return ProductStatus.OPEN;
            default:
                return ProductStatus.CLOSE;
        }
    }
}